package com.lee.strategy.enumeration;

/**
 * @author zfl_a
 * @Desc 定义了枚举类实现，也可以定义在数据库中，根据类型取值
 * @date 2020/8/10
 * @project springboot_design_pattern
 */
public enum AuditEnum {

    INNOVATE_ADUIT("2","innovateAuditServiceImpl"),
    KPI_AUDIT("3","KPIAuditServiceImpl"),
    WORK_REPORT_AUDIT("4","workReportAuditServiceImpl");

    private String type;
    private String impl;

    private AuditEnum(String type,String impl){
        this.type = type;
        this.impl = impl;
    }

    public static String getImpl(String type){
        for(AuditEnum auditEnum : AuditEnum.values()) {
            if(type.equals(auditEnum.getType())) {
                return auditEnum.getImpl();
            }
        }
        return null ;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getImpl() {
        return impl;
    }

    public void setImpl(String impl) {
        this.impl = impl;
    }
}
